#include "GameObject.h"

GameObject::GameObject()
	:CEntity()
{
	m_alive = true;
	m_isRight = true;
	m_changeAni = false;
	m_id = -1;
	m_life = 0;
	m_isRun = false;
	init();
	
}

GameObject::GameObject(int id, float posX, float posY, int width, int height)
	:CEntity(posX, posY,width,height)
{
	m_alive = true;
	m_isRight = true;
	m_changeAni = false;
	m_id = id;
	m_life = 0;
	m_isRun = false;
	init();
}

GameObject::~GameObject()
{

}

void GameObject::init()
{
	m_spriteHandler = ResourceManager::getInstance()->m_spriteHandler;
	m_camera = ResourceManager::getInstance()->m_camera;
}

void GameObject::update(float time)
{

}

void GameObject::setAnimation()
{

}

void GameObject::setRectCollsion()
{

}

void GameObject::draw()
{

}
void GameObject::destroy()
{

}

void GameObject::setGameObID(string x)
{
	// Item
	if (x == "ItemX")
	{
		m_gameObID = ITEM_X;
	}
	else if (x == "ItemB")
	{
		m_gameObID = ITEM_B;
	}
	else if (x == "ItemF")
	{
		m_gameObID = ITEM_F;
	}
	else if (x == "ItemL")
	{
		m_gameObID = ITEM_L;
	}
	else if (x == "ItemM")
	{
		m_gameObID = ITEM_M;
	}
	else if (x == "ItemR")
	{
		m_gameObID = ITEM_R;
	}
	else if (x == "ItemS")
	{
		m_gameObID = ITEM_S;
	}
	// Object
	else if (x == "BlockHouse")
	{
		m_gameObID = OB_BLOCKHOUSE;
	}
	else if (x == "BradgeEagle")
	{
		m_gameObID = OB_BRADGEEAGLE;
	}
	else if (x == "Obstacle")
	{
		m_gameObID = OB_OBSTACLE;
	}
	else if (x == "RunMan")
	{
		m_gameObID = OB_RUNMAN;
	}
	else if (x == "Sniper")
	{
		m_gameObID = OB_SNIPER;
	}

	// Background

	else if (x == "Ground")
	{
		m_gameObID = BG_GROUND;
	}
}